SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[spDepurarCapacitaciones] 

@queda INT,
@seva INT

AS
SET NOCOUNT ON
BEGIN TRANSACTION

UPDATE tb_CapacitacionesDelAgente SET Capacitacion = @queda WHERE Capacitacion = @seva
DELETE tb_Capacitaciones WHERE IdCapacitacion = @seva

IF @@error <> 0
	ROLLBACK TRANSACTION
ELSE
	COMMIT TRANSACTION
GO
